﻿using AutoMapper;
using Infrastructure.Extend;
using Infrastructure.Web;
using MyData;
using MyData.Dto;
using MyData.Models;
using MyDomain;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MyApplication
{

    public class UserInfoApp
    {
        private IUserInfoRepository _service;
        private IDepartRepository _departService;
        private ISyncRLRepository _syncRLRepository;
        public UserInfoApp(IUserInfoRepository Service,
            IDepartRepository departService,
            ISyncRLRepository syncRLRepository)
        {
            _service = Service;
            _departService = departService;
            _syncRLRepository = syncRLRepository;
        }
        public Guid Login(string userName, string passWord)
        {
            return Guid.Empty;
        }
        public PageDto<UserInfoDto> GetUserInfos(QueryListModel query, Guid departId, string WorkNum, string NickName,int NeedConfirm,int OrderName,int OrderType)
        {
            return _service.GetUserInfos(query, departId, WorkNum, NickName, NeedConfirm, OrderName,OrderType);
          
        }
        public UserInfoDto GetUserInfo(Guid Id)
        {
            var entity = _service.FindEntity(Id);
            return Mapper.Map<UserInfo, UserInfoDto>(entity);
        }
        public bool Save(UserInfo userInfo)
        {
            return _service.SaveUserInfo(userInfo);
        }
        public bool SaveConfirmUserInfo(UserInfo userInfo)
        {
            return _service.SaveConfirmUserInfo(userInfo);
        }
        public bool UserInfoDelete(List<Guid> Ids)
        {
            return _service.DeleteUserInfo(Ids);

        }
        public bool SynsUserSend(int command)
        {
            return _service.SynsUserSend(command);
        }
        public bool IsExistUser(Guid departId)
        {
            return _service.IsExistUser(departId);
        }
        public bool ConfirmUser(Guid Id)
        {
            return _service.ConfirmUser(Id);
        }
    }
}
